package utils;

public class Converter {

	public static int parseSignedInt(String s) {
		if (s.startsWith("+")) {
			return Integer.parseInt(s.substring(1));
		}

		return Integer.parseInt(s);
	}

	public static double[] toDouble(Double[] d) {
		double[] dd = new double[d.length];
		int idx = 0;
		for (double v : d) {
			dd[idx++] = v;
		}

		return dd;
	}

	public static double[] parseToDouble(String[] s) {
		double d[] = new double[s.length];
		int idx = 0;
		for (String ss : s) {
			d[idx++] = Double.parseDouble(ss);
		}

		return d;
	}

}
